libxl: introduce LIBXL_DOMAIN_TYPE_INVALID
authorDario Faggioli <raistlin@linux.it>
Wed, 6 Jun 2012 14:57:08 +0000 (15:57 +0100)
committerDario Faggioli <raistlin@linux.it>
Wed, 6 Jun 2012 14:57:08 +0000 (15:57 +0100)
commit4c0b68289377ceec17538e37abd58c3045f61281
treed546f98a92eb6dd6c219d34326ccdb8dd9229db2
parentafdeff6e5448e07159a6be78fe67908744fd9775
libxl: introduce LIBXL_DOMAIN_TYPE_INVALID

To avoid recent gcc complaining about:
libxl.c: In function 'libxl_primary_console_exec':
libxl.c:1233:9: error: case value '4294967295' not in enumerated type 'libxl_domain_type' [-Werror=switch]

Also:
 - have all the call sites of libxl__domain_type() return with error in
   case the function returns LIBXL_DOMAIN_TYPE_INVALID;
 - adjust all other code segments where -Wswitch makes would claim that
   LIBXL_DOMAIN_TYPE_INVALID is not handled by adding a "default: abort();"
   clause.

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
[ ijc -- use LIBXL_DOMAIN_TYPE_INVALID instead of -1 for
         libxl_domain_build_info.type's keyvar_init_val.
      -- what used to be libxl_primary_console_exec is now in
         libxl__primary_console_find so resolve the rejected hunk
         accordingly ]
Committed-by: Ian Campbell <ian.campbell@citrix.com>
tools/libxl/libxl.c
tools/libxl/libxl_dm.c
tools/libxl/libxl_dom.c
tools/libxl/libxl_types.idl